package vip.gadfly.tiktok.open.bean.check;


import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import vip.gadfly.tiktok.open.common.TtOpBaseResult;

import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
public class TtOpStateResult extends TtOpBaseResult {


    @JSONField(name = "description")
    @JsonAlias("description")
    @JsonProperty("description")
    @SerializedName("description")
    private String description;

    @JSONField(name = "error_code")
    @JsonAlias("error_code")
    @JsonProperty("error_code")
    @SerializedName("error_code")
    private Integer errorCode;

    @JSONField(name = "certificates")
    @JsonAlias("certificates")
    @JsonProperty("certificates")
    @SerializedName("certificates")
    private Certificates certificate;

    @Data
    public static class Certificates
    {
        @JSONField(name = "encrypted_code")
        @JsonAlias("encrypted_code")
        @JsonProperty("encrypted_code")
        @SerializedName("encrypted_code")
        private String encryptedCode;

//        券的状态，
//            0表示初始状态，
//            1 表示未使用，
//            2表示已使用，3表示退款申请中（待审核），
//            4表示退款成功，
//            5表示退款失败，
//            6表示退款中
//        备注：如果是次卡券，在次卡次数没有全部履约完成前，券状态为未使用；
        @JSONField(name = "status")
        @JsonAlias("status")
        @JsonProperty("status")
        @SerializedName("status")
        private Integer status;

        @JSONField(name = "code")
        @JsonAlias("code")
        @JsonProperty("code")
        @SerializedName("code")
        private String code;

        @JSONField(name = "expire_time")
        @JsonAlias("expire_time")
        @JsonProperty("expire_time")
        @SerializedName("expire_time")
        private Long expireTime;


        @JSONField(name = "sku")
        @JsonAlias("sku")
        @JsonProperty("sku")
        @SerializedName("sku")
        private Sku sku;

        @JSONField(name = "amount")
        @JsonAlias("amount")
        @JsonProperty("amount")
        @SerializedName("amount")
        private Amount amount;

        @JSONField(name = "verify")
        @JsonAlias("verify")
        @JsonProperty("verify")
        @SerializedName("verify")
        private Verify verify;
    }

    @Data
    public static class  Sku
    {
        @JSONField(name = "title")
        @JsonAlias("title")
        @JsonProperty("title")
        @SerializedName("title")
        private String title;

        @JSONField(name = "account_id")
        @JsonAlias("account_id")
        @JsonProperty("account_id")
        @SerializedName("account_id")
        private String accountId;

        @JSONField(name = "market_price")
        @JsonAlias("market_price")
        @JsonProperty("market_price")
        @SerializedName("market_price")
        private int marketPrice;

        @JSONField(name = "sku_id")
        @JsonAlias("sku_id")
        @JsonProperty("sku_id")
        @SerializedName("sku_id")
        private String skuId;

        @JSONField(name = "sold_start_time")
        @JsonAlias("sold_start_time")
        @JsonProperty("sold_start_time")
        @SerializedName("sold_start_time")
        private int soldStartTime;

        @JSONField(name = "third_sku_id")
        @JsonAlias("third_sku_id")
        @JsonProperty("third_sku_id")
        @SerializedName("third_sku_id")
        private String thirdSkuId;

        @JSONField(name = "groupon_type")
        @JsonAlias("groupon_type")
        @JsonProperty("groupon_type")
        @SerializedName("groupon_type")
        private Integer grouponType;

    }

    @Data
    public static class Amount
    {
        @JSONField(name = "original_amount")
        @JsonAlias("original_amount")
        @JsonProperty("original_amount")
        @SerializedName("original_amount")
        private int originalAmount;

        @JSONField(name = "pay_amount")
        @JsonAlias("pay_amount")
        @JsonProperty("pay_amount")
        @SerializedName("pay_amount")
        private int payAamount;

        @JSONField(name = "merchant_ticket_amount")
        @JsonAlias("merchant_ticket_amount")
        @JsonProperty("merchant_ticket_amount")
        @SerializedName("merchant_ticket_amount")
        private int merchantTicketAmount;

        @JSONField(name = "payment_discount_amount")
        @JsonAlias("payment_discount_amount")
        @JsonProperty("payment_discount_amount")
        @SerializedName("payment_discount_amount")
        private int paymentDiscountAmount;

        @JSONField(name = "coupon_pay_amount")
        @JsonAlias("coupon_pay_amount")
        @JsonProperty("coupon_pay_amount")
        @SerializedName("coupon_pay_amount")
        private int couponPayAmount;

    }

    @Data
    public static class Verify
    {

        @JSONField(name = "time_card")
        @JsonAlias("time_card")
        @JsonProperty("time_card")
        @SerializedName("time_card")
        private TimeCard timeCard;

    }

    @Data
    public static class TimeCard
    {

        @JSONField(name = "times_count")
        @JsonAlias("times_count")
        @JsonProperty("times_count")
        @SerializedName("times_count")
        private int timesCount;

        @JSONField(name = "times_used")
        @JsonAlias("times_used")
        @JsonProperty("times_used")
        @SerializedName("times_used")
        private int timesUsed;

    }
}
